package thread;

import java.io.File;
import java.io.IOException;



public class CopyThread extends Thread {
	
	private String srcFile;
	private String desFile;
	
	public CopyThread(String srcFile, String desFile) {
		this.srcFile = srcFile;
		this.desFile = desFile;
	}

	
	public void run() {
		FileToolkit ftk=new FileToolkit();
		try {
			File file = new File(srcFile);
			String[] files = file.list();
			File[] fileList = file.listFiles();
			for(int i=0; i<fileList.length; i++){
				ftk.copyFile(fileList[i].getAbsolutePath(), desFile);
			}
			
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
}
